package com.zb.vo;

import com.zb.annotation.NumberPattern;
import com.zb.utils.VerificUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.util.List;

/**
 * @Author WEN
 * @Date 2023/10/18 0018
 **/
@Data
@ApiModel("服务商对象")
public class NetworkVo {
    @ApiModelProperty(value = "服务商ID，新增不必传，修改必传")
    private Long id;

    @NotBlank(message = "服务商名称不能为空")
    @Length(max = 200, message = "服务商名称长度限制 200 个字符")
    @ApiModelProperty(value = "服务商名称", required = true)
    private String name;

    @Length(max = 60, message = "网点编码长度限制 60 个字符")
    @ApiModelProperty(value = "网点编码")
    private String code;

    @NotNull(message = "服务商模式不能为空")
    @NumberPattern(regexp = "^(1|2)$", message = "服务商模式参数不合法", required = true)
    @ApiModelProperty(value = "服务商模式：1-系统服务商，2-第三方服务商", required = true, example = "1")
    private Integer category;

//    @NotNull(message = "服务商类型不能为空")
//    @NumberPattern(regexp = "^0|1|2|$", message = "服务商类型参数不合法")
//    @ApiModelProperty(value = "网点服务类型：0-两者都是，1-销售网点，2-售后网点")
//    private Integer type;

    @ApiModelProperty(value = "团队类型：1-团队，2-个人")
    private Integer teamType;

    @ApiModelProperty(value = "网点分类ID")
    private Long networkTypeId;

    @NotBlank(message = "地址-省不能为空")
    @Length(max = 50, message = "地址-省长度限制 50 个字符")
    @ApiModelProperty(value = "地址-省", required = true)
    private String province;

    @NotBlank(message = "地址-市不能为空")
    @Length(max = 50, message = "地址-市长度限制 50 个字符")
    @ApiModelProperty(value = "地址-市", required = true)
    private String city;

    @NotBlank(message = "地址-区不能为空")
    @Length(max = 50, message = "地址-区长度限制 50 个字符")
    @ApiModelProperty(value = "地址-区", required = true)
    private String area;

    @Length(max = 50, message = "地址-镇长度限制 50 个字符")
    @ApiModelProperty(value = "地址-镇")
    private String town;

    @NotBlank(message = "详情地址不能为空")
    @Length(max = 200, message = "详情地址长度限制 200 个字符")
    @ApiModelProperty(value = "详细地址", required = true)
    private String address;

    @NotNull(message = "服务商状态不能为空")
    @ApiModelProperty(value = "服务商状态：false-启用，true-禁用", required = true, example = "false")
    private Boolean status;

    @ApiModelProperty(value = "服务商负责人登录账号ID", required = true, example = "0")
    private Long accountId;

    @NotBlank(message = "服务商负责人登录账号不能为空")
    @Pattern(regexp = VerificUtil.REGEX_PHONE, message = "手机号格式不正确！")
    @ApiModelProperty(value = "服务商负责人登录账号", required = true)
    private String phone;

    @NotBlank(message = "服务商负责人名称不能为空")
    @Length(max = 100, message = "服务商负责人名称长度限制 100 个字符")
    @ApiModelProperty(value = "服务商负责人名称", required = true)
    private String accountName;


    @Length(max = 500, message = "接口路径长度限制 500 个字符")
    @ApiModelProperty(value = "接口路径")
    private String path;

    @Length(max = 500, message = "数据加密公钥长度限制 500 个字符")
    @ApiModelProperty(value = "数据加密公钥")
    private String publicKey;

    @Valid
    @ApiModelProperty(value = "服务商策略对象", required = true)
    private NetworkStrategyVo strategy;

    @Valid
    @ApiModelProperty(value = "服务商自定义字段值对象")
    private List<NetworkFieldValVo> fieldVals;

    @Valid
    @ApiModelProperty(value = "服务模块结算对象")
    private List<NetworkModuleSettlementVo> moduleSettlements;

    @ApiModelProperty(value = "删除的服务模块结算对象ID")
    private List<Long> delModuleSettlementIds;

    @Valid
    @ApiModelProperty(value = "服务区域对象")
    private List<NetworkServiceAreaVo> serviceAreas;

}
